<@admin.html >
<div class="title">
<h1>编辑新闻</h1>
	<span class="tTip">标注"<em>*</em>"为必填项</span>
</div>
<div class="box">
	<div class="inner">
		<div class="tx_table">
			<h2>编辑新闻</h2>
			<form name="saveForm" id="saveForm" action="${base}/admin/news/index!save" method="post">
				<#if (news??)&&(news.id??)>
					<input type="hidden" name="news.id" value="${(news.id?c)}"/>
					<input type="hidden" name="news.status" value="${(news.status)!}"/>
					<input type="hidden" name="news.front" value="${(news.front)!}"/>
					<input type="hidden" name="news.publishDate" value="${(news.publishDate)!}"/>
				</#if>
			<div class="data">
				<table>
					<colgroup width="24%"></colgroup>
					<tbody>
						<tr>
							<th>新闻标题：</th>
							<td>
								<input class="Q" type="text" name="news.title" id="news_title" size="32" value="${(news.title)!}"/>
								<span id="news_titleTip" ></span>
							</td>
						</tr>
						
						<tr>
							<th>封面上传：</th>
							<td class="tx_sender" style="text-align:left;">
								<input id="upload_1" class="F" name="upload" type="file" value="" onchange="return ajaxFileUpload(this);"/>
								<img id="loading" src="" style="display:none;">
								<input id="hidden_1" type="hidden" name="news.cover" value=""/>
								<span id="hidden_1Tip"></span>
							</td>
						</tr>
						<tr>
							<th>图片预览（用鼠标滑动图片进行裁剪）：</th>
							<td>
								<ul class="pic_preview">
									<li>
										<span class="pic">
											<div id="imgshow_pic">
												<#if news??>
												<#if news.cover??>
												<img id="imgshow_1" width="474px" height="198px" style="overflow:hidden;" src="${(news.cover)!}"class="multiple_img" onClick="openCut(this,'hidden_1');"/>
												</#if>
												<#else>
												<img id="imgshow_1" width="474px" height="198px" style="overflow:hidden;" src="${statics}/plugins/fileupload/pic_upload_default.jpg"  class="multiple_img" onClick="openCut(this,'hidden_1');"/>
												</#if>
											</div>
										</span>
									</li>
								</ul>
							</td>
						</tr>

						<tr>
							<th>详细内容：</th>
							<td><div id="news_content"><textarea name="news.content">${(news.content)!}</textarea></div></td>
						</tr>
						<tr>
							<th>视频上传：</th>
							<td class="tx_sender" style="text-align:left;">
								<input id="upload_2" class="F" name="upload" type="file" value="" onchange="return flashFileUpload(this);"/>
								<img id="loading" src="" style="display:none;">
								<input id="hidden_2" type="hidden" name="news.flashPath" value="${(news.flashPath)!}"/>	
							</td>
						</tr>
						<tr>
							<th>音乐上传：</th>
							<td class="tx_sender" style="text-align:left;">
								<input id="upload_3"  name="upload" type="file" value="" onchange="return mp3FileUpload(this,'music_url');" style="margin-left:20px; display:inline; height:20px; width:200px;"/>
								<input id="music_url" type="hidden" name="news.mp3Path" value="${(news.mp3Path)!}"/>	
							</td>
						</tr>
					</tbody>
				</table>
				<div class="tx_sender">
						<input class="step" type="submit" value="保 存" />
				</div>
			</div>
			</form>
		</div>
	</div>
</div>

<script type="text/javascript" src="${statics}/plugins/fileupload/MEYMEY.flashupload.js" ></script>
<script type="text/javascript" src="${statics}/plugins/fileupload/MEYMEY.mp3upload.js" language="javascript"></script>
<#include "/WEB-INF/content/tag/cut.ftl">
<script type="text/javascript">
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"saveForm",onerror:function(msg){},onsuccess:function(){return true;}});					
		$("#news_title")
		.formValidator({onshow:"请输入新闻标题",onfocus:"请输入新闻标题",oncorrect:"新闻标题正确"})
		.inputValidator({min:6,max:100,onerror:"请输入新闻标题为6-100位字符,1个汉字算2位字符,请确认"});
		$("#hidden_1")
		.formValidator({onshow:"请上传图片",onfocus:"请请上传图片",oncorrect:""})
		.inputValidator({min:1});
	});
</script>

<script type="text/javascript">
	window.onload = function() {	
		var oFCKeditor = new FCKeditor( 'news.content' ) ;
		oFCKeditor.BasePath = "${statics}/plugins/editor/fckeditor/"
		oFCKeditor.ReplaceTextarea() ;
	}
</script>

</@admin.html >